package demo3;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

@Component
public class Person {
    @Autowired
    //private Shirt shirt;
     //private Sweater sweater;
    //@Qualifier("summer")
    @Qualifier("winter")
    private Clothes clothes;
    public void play(){
        //穿上衣服
//        Shirt shirt = new Shirt();//不要直接new，会产生强耦合，后续可能导致代码修改
       // shirt.wear();
          clothes.wear();
        //出去玩
        System.out.println("出去玩了");
    }
}
